package com.ruoyi.product.es;

import com.ruoyi.common.core.annotation.Excel;
import com.ruoyi.product.domain.TbBrand;
import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;
import org.springframework.data.elasticsearch.annotations.Setting;

import java.io.Serializable;
import java.util.List;

@Document(indexName = "ruoyi_prod")
@Setting(replicas = 1, shards = 1)
@Data
public class EsProd implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 商品ID
     */
    @Id
    private Long prodId;

    /**
     * SPU
     */
    @Excel(name = "SPU")
    @Field(type = FieldType.Text, analyzer = "ik_max_word")
    private String prodSpu;

    /**
     * 商品类型
     */
    @Excel(name = "商品类型")
    @Field(type = FieldType.Long, value = "1=实物商品,2=虚拟商品,3=卡密/网盘")
    private Long prodKind;

    /**
     * 商品分类
     */
    @Excel(name = "商品分类")
    private Long prodType;

    /**
     * 商品名称
     */
    @Excel(name = "商品名称")
    @Field(type = FieldType.Text, analyzer = "ik_max_word")
    private String prodName;

    /**
     * 商品品牌
     */
    @Excel(name = "商品品牌")
    @Field(type = FieldType.Long)
    private Long brandId;

    /**
     * 商品单位
     */
    @Excel(name = "商品单位")
    @Field(type = FieldType.Long, value = "1=件,2=克,3=个")
    private Long unitId;

    /**
     * 商品标签
     */
    @Excel(name = "商品标签")
    @Field(type = FieldType.Long, value = "1=秒杀商品,2=特价促销,3=新人优惠,4=新品上市,5=限时商品")
    private Long tagId;

    /**
     * 供应商
     */
    @Excel(name = "供应商")
    @Field(type = FieldType.Text, analyzer = "ik_max_word")
    private String appr;

    /**
     * 缩略图
     */
    @Excel(name = "缩略图")
    @Field(type = FieldType.Keyword)
    private String prodImage;

    /**
     * 品牌信息
     */
    private List<TbBrand> tbBrandList;


}
